package per.com.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import per.com.bean.BaseBean;
import per.com.bean.ConfigBean;
import per.com.dao.ConfigDao;

@Controller
public class ConfigController {
    private ConfigDao configDao;

    @ResponseBody
    @RequestMapping(value = "/save",method = RequestMethod.POST)
    public BaseBean add(ConfigBean configBean) {

        System.out.println(configBean);
        try{
            configDao.add(configBean);
            System.out.println(configBean);
            return new BaseBean(0,"添加成功");
        }
        catch (Exception e){
            return new BaseBean(1,"添加失败");
        }



    }
}



